package cn.newgrand.netcall.personal.contact.entity;

import java.util.Collection;
import java.util.HashSet;

import org.jivesoftware.smackx.packet.VCard;

/**
 * @author SidneyRen E-mail:SidneyRen@hotmail.com
 * @version create time：2010-10-11 下午06:16:10
 * 类说明
 * 
 * 自定义组xml定义：<personalGroups><group><name></name><members><jid></jid></members></group></customizedGroups>
 * 
 */
public class PersonalGroup {
	private String name;
	//jid
	private Collection<String> members = new HashSet<String>();
	
	public PersonalGroup() {
		super();
	}
	public PersonalGroup(String name, Collection<String> members) {
		super();
		this.name = name;
		this.members = members;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public Collection<String> getMembers() {
		return members;
	}
	public void setMembers(Collection<String> members) {
		this.members = members;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(this == obj) return true;
		if(null==obj||!getClass().isInstance(obj)) return false;
		
		final PersonalGroup pg = (PersonalGroup) obj;

		if (name != null ? !name.equals(pg.name) : pg.name != null) {
			return false;
		}
//		if (!members.equals(pg.members)) {
//			return false;
//		}
		return true;
	}
	
	@Override
	public int hashCode() {
//		int result;
//		result = members.hashCode();
//		result = 29 * result + (name != null ? name.hashCode() : 0);
//		return result;
		return name.hashCode();
	}
}
